gh-145559: Add PyUnstable_DumpTraceback() and PyUnstable_DumpTracebackThreads()#145560
gh-145559: Add PyUnstable_DumpTraceback() and PyUnstable_DumpTracebackThreads()#145560alexmalyshev wants to merge 7 commits intopython:mainfrom
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Rather than exporting internal C API functions, I would prefer to promote them as public or PyUnstable functions. |
cb5cf36 to
d7f6643
Compare
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Made them PyUnsafe_ functions. I believe that the mentions to them in the configure and emscripten files can just be deleted now that they'll be public. |
|
I believe they should have |
Ack I always make this mistake... |
d7f6643 to
28803eb
Compare
…functions These functions stopped being exported in python#107215. However, they are the only way to print a Python stacktrace safely from a signal handler, making them very useful for extensions. Re-export them as PyUnstable functions.
28803eb to
d0c95ed
Compare
|
Please, try to avoid force-push. |
|
!buildbot emscripten |
|
🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 538a1cd 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145560%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
ZeroIntensity
left a comment
There was a problem hiding this comment.
Note that PyUnstable_DumpTracebackThreads does not work well on the free-threaded build, because other threads may exit and delete their PyThreadState *. I think it's worth adding a warning for that. Here's an example:
.. warning::
On the :term:`free-threaded build`, this function is not thread-safe. If
another thread deletes its :term:`thread state` while this function is being
called, the process will likely crash.Comment says 100, but it appears to have been 500 since 2012, 54f939b.
ZeroIntensity
left a comment
There was a problem hiding this comment.
One little issue with the blurb entry, but otherwise this looks good.
| @@ -0,0 +1 @@ | |||
| Rename `_Py_DumpTraceback` and `_Py_DumpTracebackThreads` to `PyUnstable_DumpTraceback` and `PyUnstable_DumpTracebackThreads`. | |||
There was a problem hiding this comment.
| Rename `_Py_DumpTraceback` and `_Py_DumpTracebackThreads` to `PyUnstable_DumpTraceback` and `PyUnstable_DumpTracebackThreads`. | |
| Rename ``_Py_DumpTraceback`` and ``_Py_DumpTracebackThreads`` to :c:func:`PyUnstable_DumpTraceback` and :c:func:`PyUnstable_DumpTracebackThreads`. |
vstinner
left a comment
There was a problem hiding this comment.
LGTM.
It's unusual that PyUnstable_DumpTracebackThreads() returns an error message on error rather than raising an exception, but it's explained by the fact that the function can be called without an attached thread thread.
These functions stopped being exported in #107215. However, they are the only way to print a Python stacktrace safely from a signal handler, making them very useful for extensions. Re-export them.